#ifndef SHIP_H_
#define SHIP_H_

#include "../WidgetMovimiento.h"
#include "../Event.h"
#include "ShipStatus.h"
#include "../Timer.h"

class Ship: public WidgetMovimiento {

private:
	std::string imagePath;
	float rotationVelocity;
	int maximumVelocity;
	int propulsion;
	int friction;
	int bulletLifeTime;

	bool goingForward;
	bool goingBackwards;
	bool turningLeft;
	bool turningRight;
	bool shooting;
	bool keyPressed;
	int frame;
	int timeElapsedPropulsion;
	int timeElapsedFriction;
	Timer timer;
	Timer timerAux;
	bool combustionEffect;
	std::string owner;
	float actualVelocity;

	SDL_Surface* shipSurface;
	SDL_Surface* combustionShipSurface;

	void loadSurfaceImageFiles();

protected:

	Ship();

public:

	Ship(ShipStatus* shipStatus);

	Ship(std::string pathImage,float rotationVelocity,int velMaxima,int propulsion,
			int friccion,int duracionBala, int posX, int posY,
			Widget* parent, std::string owner,int angle = 90);

	virtual void handleEvent(Event event);

	virtual void resolve();

	ShipStatus getShipStatus();

	std::string getOwner();

	int getBulletX();
	int getBulletY();
	int getBulletAngle();
	bool isShooting();

	bool duenoesinstancialocal;

	int getBulletLifeTime();

	virtual ~Ship();
};

#endif /* Ship_H_ */
